package cn.edu.qzuie.artist.module.td.api.school;

import cn.edu.qzuie.artist.module.td.api.school.dto.TdSchoolSelectRespDTO;
import cn.edu.qzuie.artist.module.td.convert.school.SchoolConvert;
import cn.edu.qzuie.artist.module.td.service.school.SchoolService;

import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
@Validated
public class TdSchoolApiImpl implements TdSchoolApi{
    @Resource
    private SchoolService schoolService;
    @Override
    public List<TdSchoolSelectRespDTO> getSchool() {
        return SchoolConvert.INSTANCE.convertList(schoolService.getSchool());
    }

    @Override
    public List<TdSchoolSelectRespDTO> getSchool(Long regionId) {
        return  SchoolConvert.INSTANCE.convertList(schoolService.getSchoolByRegionId(regionId));
    }
}
